package com.qixin.api.serviceimpl;


import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.qixin.api.bean.ComPeople;
import com.qixin.api.bean.ResultPage;
import com.qixin.api.bean.VoPage;
import com.qixin.api.bean.WePilejoin;
import com.qixin.api.mapper.WePilejoinMapper;
import com.qixin.api.service.WePilejoinService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 桩源加盟 服务实现类
 * </p>
 *
 * @author 李许多
 * @since 2018-11-15
 */
@Service
public class WePilejoinServiceImpl extends ServiceImpl<WePilejoinMapper, WePilejoin> implements WePilejoinService {
    @Override
    public ResultPage<WePilejoin> selectALL(VoPage voPage) {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("page", (voPage.getPage() - 1) * voPage.getLimit());
        paramMap.put("limit", voPage.getLimit());
        List<WePilejoin> list = baseMapper.selectALL(paramMap);
        Integer count = baseMapper.countMyPage(paramMap);
        ResultPage<WePilejoin> resultPage = new ResultPage<>();
        resultPage.setCode(0);
        resultPage.setCount(count);
        resultPage.setMsg("成功");
        resultPage.setData(list);
        return resultPage;
    }
}
